<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>基础表单</title>
    <link rel="stylesheet" href="/Application/iframe/assets/libs/layui/css/layui.css"/>
    <link rel="stylesheet" href="/Application/iframe/assets/module/admin.css?v=318"/>
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        #formBasForm {
            max-width: 700px;
            margin: 30px auto;
        }

        #formBasForm .layui-form-item {
            margin-bottom: 25px;
        }
    </style>
</head>
<body>
<!-- 正文开始 -->
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body">
            <!-- 表单开始 -->
            <form class="layui-form"  lay-filter="formBasForm" method="post" action="<?php echo U('ShoppingMall/class_img_adds');?>" enctype="multipart/form-data">

                <div class="layui-form-item">
                    <label class="layui-form-label">选择分类:</label>
                    <div class="layui-input-block">
                        <select name="id" lay-verify="required">
                            <option value=""></option>
                            <?php if(is_array($data)): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$data): $mod = ($i % 2 );++$i;?><option value="<?php echo ($data['id']); ?>"><?php echo ($data['class_name']); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                        </select>
                    </div>
                </div>



                <div class="layui-form-item">
                    <label class="layui-form-label layui-form-required">选择图片:</label>
                    <div class="layui-input-block">
                        <input name="images" type="file">
                    </div>
                </div>



                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <button class="layui-btn" lay-submit>&emsp;提交&emsp;</button>
                        <button type="reset" class="layui-btn layui-btn-primary">&emsp;重置&emsp;</button>
                    </div>
                </div>
            </form>
            <!-- //表单结束 -->
        </div>
    </div>
</div>

<!-- js部分 -->
<script type="text/javascript" src="/Application/iframe/assets/libs/layui/layui.js"></script>
<script type="text/javascript" src="/Application/iframe/assets/js/common.js?v=318"></script>
<script>
    layui.use(['layer', 'form', 'laydate'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var laydate = layui.laydate;

        /* 渲染laydate */
        laydate.render({
            elem: '#formBasDateSel',
            trigger: 'click',
            range: true
        });

        /* 监听表单提交 */
        form.on('submit(formBasSubmit)', function (data) {
            // console.log(data.field);
            // // layer.msg(JSON.stringify(data.field));
            // $.get('<?php echo U('site/adddevice');?>', data.field, function (res) {
            //     console.log(res);
            //     // layer.close(loadIndex);
            //     // if (200 === res.code) {
            //     //     layer.close(dIndex);
            //     //     layer.msg(res.msg, {icon: 1});
            //     //     insTb.reload({page: {curr: 1}});
            //     // } else {
            //     //     layer.msg(res.msg, {icon: 2});
            //     // }
            // }, 'json');
            // return false;
        });

    });
</script>
</body>
</html>